//
//  PxOilNetSession.h
//  OilCard
//
//  Created by Xu Yefeng on 14-5-18.
//  Copyright (c) 2014年 Free. All rights reserved.
//
#import "LLSmallUtil.h"
#import "Constants.h"
#import "FMDatabase.h"

@interface PxGlobal : NSObject

+ (instancetype)shared;
+ (NSString *)getConfig:(NSString *)key;

+ (CGFloat)getBaseHeight:(BOOL)withBottom;
+ (CGFloat)getCustomerWidth:(CGFloat)baseWidth;
+ (CGFloat)getCustomerHeight:(CGFloat)baseHeight;
+ (UIImage*) imageWithColor:(UIColor*)color;
+ (id)duplicate:(UIView*)view;

+(int)scanNumber:(NSString *) str;

+(void)appendData:(id)value andKey:(NSString *)key;
+(void)saveData:(id)value andKey:(NSString *)key;
+(id)getData:(NSString *)key;
+(void)removeData:(NSString *)key;
+(void)clearAllUserDefaultsData;
+(NSString *)getDicValue:(NSString *)key fromDic:(NSDictionary *)dic;
+(NSMutableDictionary *)getDicFromFMResultSet:(FMResultSet *)set;
+(void)openDB;
+(NSMutableDictionary *)selectTable:(NSString *)tableName withRowId:(NSString *)rowId;
+(NSMutableArray *)selectTable:(NSString *)tableName withData:(NSString *)waybillNo;
+(int)insertOrUpdateTable:(NSString *)tableName withData:(NSDictionary *)dic;
+(BOOL)updateTable:(NSString *)tableName withData:(NSDictionary *)dic;
+(void)deleteTabel:(NSString *)tableName withID:(int) index;

@property (nonatomic, retain) FMDatabase *db;
@property (nonatomic, retain) NSDictionary *plist;
@property (nonatomic, retain) NSString *plistPath;

@end
